home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6708 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  982 b 

  1. Path: news1.ucsd.edu!usenet
  2. From: "Eric C. Liebl" <ecl@canna.ucsd.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Keyboard buffer problems...please help!
  5. Date: Sat, 17 Feb 1996 21:11:35 -0800
  6. Organization: UC San Diego
  7. Message-ID: <3126B507.4052@canna.ucsd.edu>
  8. NNTP-Posting-Host: eliebl.extern.ucsd.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. I am looking for a C command that will flush the keyboard buffer before 
  15. it is read.  I am using Borland C/C++ 4.0 to compile my program.  
  16. Basically, I have a do while loop with getch() initiated when kbhit is 
  17. true...when an appropriate key is hit I update graphics, etc. in my 
  18. program.  However, if a user holds the key down the key data fills the 
  19. keyboard buffer and I get an annoying beep and too many "moves" get 
  20. stored up in advance.
  21.  
  22. So, can anyone help me out with this?  Any help would be most 
  23. appreciated.  Thanks.
  24.  
  25. Eric Liebl
  26. ecl@canna.ucsd.edu
  27.